Fix optional deps in multiple sections
authorAlex Crichton <alex@alexcrichton.com>
Fri, 4 May 2018 16:19:30 +0000 (09:19 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 4 May 2018 21:06:59 +0000 (14:06 -0700)
commit2f88a70407499796f69b2f5241bf929cda01d903
treeaa2613c2e4e20db480dd781d3bb6bbfcd6fcba14
parent1ca44da30b6e4190b6fc0b92a97e4c7e82ceee26
Fix optional deps in multiple sections

This commit fixes an issue where an optional dependency was listed multiple
times in a manifest (multiple sections). This regression was introduced by #5415
and happened because in the resolver we didn't record a `Dependency` as it was
accidentally deduplicated too soon.

The fix here was to ensure that all `Dependency` annotations make their way into
`Resolve` now that we rely on the listed `Dependency` values for correctness.

Closes #5475
src/cargo/core/resolver/context.rs
tests/testsuite/build_script.rs